//
//  ChangeBiliViewController.m
//  WULIHH
//
//  Created by chen tang on 16/4/13.
//  Copyright © 2016年 tang. All rights reserved.
//

#import "ChangeBiliViewController.h"
#import "Header.h"

@interface ChangeBiliViewController ()<UIScrollViewDelegate>
{
    UIScrollView *mainScrollView;
    UIImageView *imageView;
    
}
@end

@implementation ChangeBiliViewController

- (void)loadView
{
    [super loadView];
    
    mainScrollView = [[UIScrollView alloc] init];
    [self.view addSubview:mainScrollView];
    
    imageView = [[UIImageView alloc] initWithFrame:mainScrollView.bounds];
    [mainScrollView addSubview:imageView];
    
    
    
    UIButton *cancleButton = [[UIButton alloc] init];
    [self.view addSubview:cancleButton];
    [cancleButton addTarget:self action:@selector(removeView) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *saveButton = [[UIButton alloc] init];
    [self.view addSubview:saveButton];
    [saveButton addTarget:self action:@selector(saveImage) forControlEvents:UIControlEventTouchUpInside];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [mainScrollView setDelegate:self];
    
    [imageView setImage:_image];
    [mainScrollView setContentSize:CGSizeMake(_image.size.width, _image.size.height)];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)removeView
{
    [self dismissViewControllerAnimated:YES completion:nil];
}


- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
    return imageView;
}


#pragma mark----保存图片
- (void)saveImage
{
    
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
